#!/usr/bin/env python
# coding=utf-8
"""
@Author  : youjia - 卞志伟
@file    : alchemydb.py
@contact : bianzhiwei@iyoujia.com
@time    : 2019-09-05 10:46 
@Desc    : 
@Software: PyCharm
"""
import os
import sys

# 当前文件的路径
pwd, filename = os.path.split(os.path.abspath(__file__))
# 当前文件的父路径
father_path = os.path.abspath(os.path.dirname(pwd) + os.path.sep + ".")
# 当前文件的前两级目录
grader_father = os.path.abspath(os.path.dirname(pwd) + os.path.sep + "..")
sys.path.append(pwd)
sys.path.append(father_path)
sys.path.append(grader_father)

from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from report_system.utils.db_util import db_youjia_url
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = db_youjia_url
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True
app.config['SQLALCHEMY_COMMIT_TEARDOWN'] = True
app.config["SQLALCHEMY_COMMIT_ON_TEARDOWN"] = True
app.config['SQLALCHEMY_ECHO'] = False
db = SQLAlchemy(app)
